/**
	* Copyright (c) minuteproject, minuteproject@gmail.com
	* All rights reserved.
	* 
	* Licensed under the Apache License, Version 2.0 (the "License")
	* you may not use this file except in compliance with the License.
	* You may obtain a copy of the License at
	* 
	* http://www.apache.org/licenses/LICENSE-2.0
	* 
	* Unless required by applicable law or agreed to in writing, software
	* distributed under the License is distributed on an "AS IS" BASIS,
	* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	* See the License for the specific language governing permissions and
	* limitations under the License.
	* 
	* More information on minuteproject:
	* twitter @minuteproject
	* wiki http://minuteproject.wikispaces.com 
	* blog http://minuteproject.blogspot.net
	* 
*/
/**
	* template reference : 
	* - name : OpenxavaDomainObjectUML
	* - file name : DomainObjectUMLJPAAnnotationOXAnnotationV4.vm
*/
package sistema_oficial.sistema_oficial.domain.sistemaoficial;

//MP-MANAGED-ADDED-AREA-BEGINNING @import@
//MP-MANAGED-ADDED-AREA-ENDING @import@
import java.sql.*;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.util.Set;
import java.util.HashSet;

import javax.persistence.*;
import org.openxava.annotations.*;

import sistema_oficial.sistema_oficial.domain.sistemaoficial.Colaborador;
import sistema_oficial.sistema_oficial.domain.sistemaoficial.NivelEscolar;

/**
 *
 * <p>Title: EstudioRealizado</p>
 *
 * <p>Description: Domain Object describing a EstudioRealizado entity</p>
 *
 */
@Entity (name="EstudioRealizado")
@Table (name="estudio_realizado")
@Views({
//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @view-base-estudio_realizado@
	@View(
		name="base",
		members=
        "" 	
        + "identificador  ; "
        + "nivelCompletado  ; "
        + "diplomaObtenido  ; "
        + "fechaObtenido  ; "
        + "colaboradorIdentificador  ; "
        + "nivelEscolarIdentificador  ; "
		),
//MP-MANAGED-UPDATABLE-ENDING
	@View(
		name="Create", 
		extendsView="base"
	),
	@View(
		name="Update", 
		extendsView="base",
        members=
          "" 	
	),
	@View(extendsView="base",
        members=
          "" 	
	),
    @View(name="estudioRealizadoDEFAULT_VIEW", 
	   members=
          " identificador ;" 	
        + "nivelCompletado  ; "
        + "diplomaObtenido  ; "
        + "fechaObtenido  ; "
	),
//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @view-reference-estudio_realizado@
    @View(name="reference", 
       extendsView="estudioRealizadoDEFAULT_VIEW"
//MP-MANAGED-UPDATABLE-ENDING
    )
})

@Tabs({
@Tab(
properties=
     " nivelCompletado "
    +",  diplomaObtenido "
    +",  fechaObtenido "
)
,
@Tab(
name = "EstudioRealizadoTab",
properties=
     " nivelCompletado "
    +",  diplomaObtenido "
    +",  fechaObtenido "
)
,
@Tab(
name = "EstudioRealizadoTabWithRef",
properties=
     " nivelCompletado "
    +",  diplomaObtenido "
    +",  fechaObtenido "
)
})
//MP-MANAGED-ADDED-AREA-BEGINNING @class-annotation@
//MP-MANAGED-ADDED-AREA-ENDING @class-annotation@
public class EstudioRealizado {

    @Hidden @Id @Column(name="identificador" )
    private Integer identificador; 

//MP-MANAGED-ADDED-AREA-BEGINNING @nivel_completado-field-annotation@
//MP-MANAGED-ADDED-AREA-ENDING @nivel_completado-field-annotation@

//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @ATTRIBUTE-nivel_completado@
    @Column(name="nivel_completado",   nullable=false,  unique=false)
    @Required
    private Boolean nivelCompletado;	
//MP-MANAGED-UPDATABLE-ENDING

//MP-MANAGED-ADDED-AREA-BEGINNING @diploma_obtenido-field-annotation@
//MP-MANAGED-ADDED-AREA-ENDING @diploma_obtenido-field-annotation@

//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @ATTRIBUTE-diploma_obtenido@
    @Column(name="diploma_obtenido",  length=50,  nullable=true,  unique=false)
    private String diplomaObtenido;	
//MP-MANAGED-UPDATABLE-ENDING

//MP-MANAGED-ADDED-AREA-BEGINNING @fecha_obtenido-field-annotation@
//MP-MANAGED-ADDED-AREA-ENDING @fecha_obtenido-field-annotation@

//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @ATTRIBUTE-fecha_obtenido@
    @Column(name="fecha_obtenido",    nullable=true,  unique=false)
    private Date fechaObtenido;	
//MP-MANAGED-UPDATABLE-ENDING


//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @parent-Colaborador-estudio_realizado@
    @ManyToOne (fetch=FetchType.LAZY ,optional=false) //remove optional=false to aggragate but leads to a side effect when going directly to the entity: required check is not performed=> if no set DB check constraint is raised...
    @JoinColumn(name="colaborador_identificador", nullable=false,  unique=false  )
    @ReferenceView ("reference") 
    private Colaborador colaboradorIdentificador; 
    
//MP-MANAGED-UPDATABLE-ENDING
//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @parent-NivelEscolar-estudio_realizado@
    @ManyToOne (fetch=FetchType.LAZY ,optional=false) //remove optional=false to aggragate but leads to a side effect when going directly to the entity: required check is not performed=> if no set DB check constraint is raised...
    @JoinColumn(name="nivel_escolar_identificador", nullable=false,  unique=false  )
    @ReferenceView ("reference") 
    private NivelEscolar nivelEscolarIdentificador; 
    
//MP-MANAGED-UPDATABLE-ENDING
//children
//m2m
    /**
    * Default constructor
    */
    public EstudioRealizado() {
    }


    public Integer getIdentificador() {
        return identificador;
    }
	
    public void setIdentificador (Integer identificador) {
        this.identificador =  identificador;
    }
    

//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @GETTER-SETTER-nivel_completado@
    public Boolean getNivelCompletado() {
        return nivelCompletado;
    }
	
    public void setNivelCompletado (Boolean nivelCompletado) {
        this.nivelCompletado =  nivelCompletado;
    } 
//MP-MANAGED-UPDATABLE-ENDING

//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @GETTER-SETTER-diploma_obtenido@
    public String getDiplomaObtenido() {
        return diplomaObtenido;
    }
	
    public void setDiplomaObtenido (String diplomaObtenido) {
        this.diplomaObtenido =  diplomaObtenido;
    } 
//MP-MANAGED-UPDATABLE-ENDING

//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @GETTER-SETTER-fecha_obtenido@
    public Date getFechaObtenido() {
        return fechaObtenido;
    }
	
    public void setFechaObtenido (Date fechaObtenido) {
        this.fechaObtenido =  fechaObtenido;
    } 
//MP-MANAGED-UPDATABLE-ENDING


    public Colaborador getColaboradorIdentificador () {  //
    	return colaboradorIdentificador;
    }
	
    public void setColaboradorIdentificador (Colaborador colaboradorIdentificador) {
    	this.colaboradorIdentificador = colaboradorIdentificador;//this.colaboradorIdentificador = colaborador;
    }
    public NivelEscolar getNivelEscolarIdentificador () {  //
    	return nivelEscolarIdentificador;
    }
	
    public void setNivelEscolarIdentificador (NivelEscolar nivelEscolarIdentificador) {
    	this.nivelEscolarIdentificador = nivelEscolarIdentificador;//this.nivelEscolarIdentificador = nivelEscolar;
    }




//MP-MANAGED-ADDED-AREA-BEGINNING @implementation@
//MP-MANAGED-ADDED-AREA-ENDING @implementation@

}
